from pypatnlp import *
from pprint import pprint

# load a sample of the estner corpus
corpus = PyCorpus('data/estner.pycorp', readonly=True, subset=['0', '1'])

print 'Cover of words, that are annotated PER'
cover = regex_cover(corpus, 'ne_type', 'PER', )
pprint(cover_values(corpus, 'word', cover))

print 'Cover of words, that are at most 2 words away from a word annotated as PER'
cover = context_cover(corpus, 'ne_type', 'PER', 1)
pprint(cover_values(corpus, 'word', cover))

print 'Consequent elements'
cover = as_tuple_cover(cover)